home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
misc
/
football
/
exec
/
results.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
4KB
|
131 lines
/* ***********************************************************************
RESULTS PROGRAM FOR FOOTBALL REXX SUITE
---------------------------------------
Copyright Mark Naughton 1996
Version Date History
--------------------------------------------------------------------------
1.0 270996 First release. Displays all results from 'Teams.sf'
file.
1.1 121196 Updated to get arguments and to use '*.sflearn' to get
a true display as '.sf' was in order. Now called as a
component of FOOTBALL.
131196 Added checks for files - if not found, exits without
a message.
211196 Updated and tidied the display.
190497 Added title to display.
1.2 060997 Amended to handle new Automatic Scheduling schedules.
Removed - new program for this. Formatting needs to be
handled properly.
151297 Tidied display.
180499 Improved match/fixture display.
310599 Changed to accommodate extra data in '.sflearn' file.
250899 Added error msg to file check.
270899 Converted to use locale. Some error messages, before
reading the locale, will still be in English.
**************************************************************************
Procedure
---------
1. Check files exist.
2. Open file and print all lines without '*' with the exception of
the league name which is underlined; possibly dates as well.
3. Close file and exit.
************************************************************************** */
parse arg league_file
version = 1
league_file = "Data/" || league_file
input_file = '.sflearn'
separator = '*'
separator2 = '**'
addlib('rexxsupport.library',0,-30,0)
if open(datafile,"Data/Football.locale",'r') then do
line = readln(datafile)
locdir = strip(line)
close(datafile)
end
else do
say
say "ERROR : (Results)"
say
say "Cannot read 'Data/Football.locale' for the locale settings."
exit
end
locdir = locdir"Exec/Results.data"
if open(datafile,"ENV:FootballRXPath",'r') then do
line = readln(datafile)
rxdir = strip(line)
close(datafile)
end
else
rxdir = "SYS:Rexxc/"
if exists(locdir) > 0 then do
address command rxdir'rx 'locdir
VarCount = getclip('VarCount')
do i = 1 to VarCount
interpret getclip('var.'i)
end
end
else do
say
say "ERROR : (Results)"
say
say "Cannot find '"locdir"' to read locale settings."
exit
end
if exists(league_file || input_file) = 0 then do
say
say rs_error
say
say rs_one"'"league_file||input_file"'."
exit
end
if open(datafile,league_file || input_file,'r') then do
say
say center(rs_four,78)
say "-------------------------------------------------------------------------------"
say
do while ~eof(datafile)
line = readln(datafile)
if pos(separator,line) = 0 then do
t1 = right(strip(substr(line,1,30)),30,' ')
say t1||substr(line,31)
end
else do
if pos(separator2,line) > 0 then do
say subword(line,2)
uline = ''
do i=1 to length(subword(line,2))
uline = insert('-',uline,i,1)
end
say strip(uline)
end
else
if line = separator then
say
end
end
say "-------------------------------------------------------------------------------"
close(datafile)
end
else do
say
say rs_error
say
say rs_two"'"league_file||input_file"'"rs_three
end
exit